package com.xand.bt.terminal.ui.toolbar;

import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JToolBar;

import com.xand.bt.terminal.ui.UIConst;

public class MainToolbarDisplay {

	private JPanel jPanel;
	
	private JToolBar jToolbar;
	
	public MainToolbarDisplay() {
		this.jPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
		this.jPanel.setBorder(UIConst.MAIN_TOOLBAR_PANEL_BORDER);
		this.jPanel.setPreferredSize(UIConst.MAIN_TOOLBAR_PANEL_SIZE);
		
		this.jToolbar = new JToolBar();
		
		this.jToolbar.setBorder(UIConst.EMPTY_BORDER);
		
		this.jToolbar.add(this.createButton("Login"));
		this.jToolbar.add(this.createButton("Logout"));
		this.jToolbar.add(this.createButton("New bid"));
		this.jToolbar.add(this.createButton("New ask"));
		this.jToolbar.add(this.createButton("Orders"));
		this.jToolbar.add(this.createButton("Trades"));
		this.jToolbar.add(this.createButton("Exit"));
		
		this.jPanel.add(this.jToolbar);
	}
	
	private JButton createButton(String text) {
		
		JButton jButton = new JButton();
		
		jButton.setText(text);
		
		return jButton;
	}
	
	public JPanel getPanel() {
		return this.jPanel;
	}
}
